#include <iostream>
#include <vector>
using namespace std;

struct ListNode {
    int val;
    ListNode* next;
    ListNode() : val(0), next(nullptr) {}
    ListNode(int x) : val(x), next(nullptr) {}
    ListNode(int x, ListNode* next) : val(x), next(next) {}
    
};

class Solution {
public:
    ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) {
        return dfs(list1, list2);
    }

    ListNode* dfs(ListNode* l1, ListNode* l2)
    {
        if (l1 == nullptr) return l2;
        if (l2 == nullptr) return l1;
        if (l1->val < l2->val)
        {
            l1->next = dfs(l1->next, l2);
            return l1;
        }
        else
        {
            l2->next = dfs(l1, l2->next);
            return l2;
        }
    }
};

class A
{
public:
    virtual void fun1()
    {
        //...
    }

    virtual void fun2()
    {
        //...
    }

    void fun3()
    {
        //...
    }
private:
    int _m;
    int _n;
};

class B : public A
{
public:
    virtual void fun1()
    {
        //...
    }

    virtual void fun4()
    {
        cout << "B" << endl;
    }
private:
    int _q;
};

class C : public B
{
public:
    virtual void fun4()
    {
        cout << "C" << endl;
    }
};

int main()
{
    A a;
    B b;
    C c;

    b.fun4();
    c.fun4();
    return 0;
}

//ab 14 c7 8e f6 7f 00 00 1f 14 c7 8e
//1f 14 c7 8e f6 7f 00 00 00 00 00 00
//10 25 c7 8e f6 7f